package com.fulu.game.bi.mysql.playadmin.channel;

import com.fulu.game.bi.entity.po.channel.RegistSource;
import com.fulu.game.bi.entity.vo.channel.source.RegisterSourceDisplayVO;
import com.fulu.game.bi.entity.vo.channel.source.RegisterSourceQueryVO;
import com.fulu.game.bi.mysql.bi.ICommonDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author yanbiao
 * @date 2018-06-13 15:33:21
 */
@Mapper
public interface RegistSourceDao extends ICommonDao<RegistSource, Integer> {

    List<RegisterSourceDisplayVO> findByParameter(RegisterSourceQueryVO vo);

    List<RegisterSourceDisplayVO> listWithCount();

    /**
     * 查询CJ的注册来源详情
     */
    RegistSource findCjRegistSource();

    /**
     * 根据名称查询注册来源
     */
    RegistSource findByName(String name);

    List<RegistSource> findByPlatforms(Integer[] platforms);

    List<RegistSource> findByNames(String[] names);

    int insert(RegistSource rs);

    int createBatch(List<RegistSource> list);

    /**
     * 更新非空字段
     */
    void updateSelective(RegistSource rs);

    /**
     * 根据ID查询
     */
    RegistSource findById(@Param("id") Integer id);

    /**
     * 根据分组ID获取分组
     */
    List<RegistSource> findByIds(@Param("ids") List<Integer> ids);

    /**
     * 查询所有
     */
    List<RegistSource> findAll();
}
